<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>旅游首页</title>
    <link rel="stylesheet" href="../../css/amazeui.min.css">
    <link rel="stylesheet" href="css/app.css">
    <style>
    	.clear{clear:both;}
    	.guoqi01{float:left;width: 30%;padding: 13px;}
		.diming01{float:left;width: 100%;text-align: center;font-size:14px;}
    </style>
</head>
<body>


<div id='header' class="am-g am-topbar-fixed-top" style="padding:0 0;background:#ffaa43;height:auto;">
	<div  onclick="api.closeWin();"  class="am-u-sm-2" style="margin-top:12px;padding-left: 17px">
		<img  src="images/arr-l.png" style="height:14px;height: 18px;"/>
	</div> 
	<div class="am-u-sm-8 til" style="margin-top:13px;text-align:center;">
		<h1 id="title">亚洲旅游国家</h1>
	</div>
	<div class="am-u-sm-2" style="font-size: 20px;margin-top:10px;color:white;text-align:center;">

   </div>
   
</div>

<div class="am-g">
	<div class="am-u-sm-12" style="margin-top: 60px;border-bottom:2px solid #666;font-size: 18px" id="tip">
	   
	</div>
</div>

<div class="am-g" id="list">

    <!--<div class="guoqi01">
        <img src="images/visa/tu4.png">
        <div class="diming01">
            中国
        </div>
    </div>
    

     <div class="guoqi01">
        <img src="images/visa/tu4.png">
        <div class="diming01">
            中国
        </div>
    </div>
    

     <div class="guoqi01">
        <img src="images/visa/tu4.png">
         <div class="diming01">
            中国
        </div>
    </div>-->
   
</div>



</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
	var list = [];
	var state;

	apiready = function(){
		state = api.pageParam.state;
		
		$api.html($api.byId('title'), state+'旅游国家');
		$api.html($api.byId('tip'), state);
		
		loadData();
	};
	
	function loadData(){
		api.showProgress({
			title: '加载中...',
			modal: false
		});
		
		var url = serviceUrl + '/app/visa/country?state=' + state;
	
		$api.get(url, function(ret){
			api.hideProgress();
			
		    if(ret){
		    	list = ret.data;
		    	showlist();
		    }
		  
		},'json');
		
	}
	
	function showlist(){
		var aHtml = "";

		if(list.length > 0){
			
			for(var i = 0; i < list.length; i++){
				var country = list[i];
				
				aHtml += '<div class="guoqi01" onclick="entervisa(\''+ country.name +'\');">';
					aHtml += '<img src="' + serviceUrl+country.img + '">';
					aHtml += '<div class="diming01">';
						aHtml += country.name;
			        aHtml += '</div>';
			    aHtml += '</div>';
			}
		}else{
	       aHtml += '<div class="am-u-sm-12" style="margin-top:10px;text-align:center">暂无数据...</div>'
	    }
		
		$api.html($api.byId('list'), aHtml);
	}
	
	function entervisa(name){

		openWin('qianzheng', {'country':name});
	}
	
</script>
</html>